package work;

import java.util.Scanner;

public class ThrowDemo {
    public static void main(String[] args) {


        Student zs = new Student();
        try{
            zs.setAge(1000);
            System.out.println("年龄:"+zs.getAge()+"岁");
        }catch(RuntimeException e){
            System.out.println(e);
            System.out.println("年龄不合法");
        }
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
    }
}
